package com.ffsky.template.demo.app;

import android.view.View;

import com.ffsky.template.demo.databinding.ActivityWaveBinding;
import com.gitee.hljdrl.ffkit.app.FFKitActivity;

public class WaveActivity extends FFKitActivity {

    ActivityWaveBinding binding;
    @Override
    public View getBindingView() {
        binding = ActivityWaveBinding.inflate(getLayoutInflater());
        return binding.getRoot();
    }

    @Override
    public void initView() {
        binding.btnVoice.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if(binding.waveViewVoice.isRunning()){
                    binding.waveViewVoice.setVisibility(View.GONE);
                    binding.btnVoice.setText("开始");
                }else{
                    binding.waveViewVoice.setVisibility(View.VISIBLE);
                    binding.btnVoice.setText("停止");
                }
            }
        });

        binding.btnLine.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if(binding.waveViewLine.isRunning()){
                    binding.waveViewLine.setVisibility(View.GONE);
                }else{
                    binding.waveViewLine.setVisibility(View.VISIBLE);
                }
            }
        });
    }

    @Override
    public void initData() {

    }

    @Override
    public void initListener() {

    }
}
